import 'package:json_annotation/json_annotation.dart';


class TestBean {
  Map<String, dynamic> args;
  Map<String, String> headers;
  String origin;
  String url;

  TestBean({
    required this.args,
    required this.headers,
    required this.origin,
    required this.url,
  });


   //map生成实体类，要手动生成，可以利用ai，@JsonSerializable() 方式太麻烦还要找到文件运行命令
  factory TestBean.fromJson(Map<String, dynamic> json) {
    return TestBean(
      args: Map<String, dynamic>.from(json['args'] ?? {}),
      headers: Map<String, String>.from(json['headers'] ?? {}),
      origin: json['origin'] ?? '',
      url: json['url'] ?? '',
    );
  }
 //实体类生成map
  Map<String, dynamic> toJson() {
    return {
      'args': args,
      'headers': headers,
      'origin': origin,
      'url': url,
    };
  }
}
